<?php

namespace App\Http\Middleware;

use Closure;

class CheckAge
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        if ($request->age <= 200) {
            echo "front","<hr />";
        }

        return $next($request);
        /*
        $response =  $next($request);

        echo "background";

        return $response;
        */
    }
    public function terminate($request, $response)
    {
        // Store the session data...
        echo "<hr />";

        print_r($response);
        echo "finish";
    }
}
